package com.test.action;

import com.opensymphony.xwork2.ActionSupport;
import com.test.manager.LoginManager;

@SuppressWarnings("serial")
public class LoginAction extends ActionSupport {
	private LoginManager loginManager;
	private String username;
	private String password;
 
	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public void setLoginManager(LoginManager loginManager) {
		this.loginManager = loginManager;
	}
	
	@Override
	public String execute() throws Exception {

		if(loginManager.isLogin(username, password))
		{
			return SUCCESS;
		}
		return INPUT;
	}
}
